home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH4 / 4-2-4.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  1.6 KB  |  56 lines

  1. VERSION 5.00
  2. Begin VB.Form frm4_2_4 
  3.    Caption         =   "4-2-4"
  4.    ClientHeight    =   1320
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   2580
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1320
  20.    ScaleWidth      =   2580
  21.    Begin VB.PictureBox picResults 
  22.       Height          =   495
  23.       Left            =   480
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   1635
  26.       TabIndex        =   1
  27.       Top             =   120
  28.       Width           =   1695
  29.    End
  30.    Begin VB.CommandButton cmdDisplay 
  31.       Caption         =   "Display Numbers"
  32.       Height          =   495
  33.       Left            =   480
  34.       TabIndex        =   0
  35.       Top             =   720
  36.       Width           =   1695
  37.    End
  38. Attribute VB_Name = "frm4_2_4"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdDisplay_Click()
  44.   'Demonstrate that variables in a subprogram do
  45.   'not retain their values in subsequent calls
  46.   picResults.Cls
  47.   Call Three
  48.   Call Three
  49. End Sub
  50. Private Sub Three()
  51.   Dim num As Single
  52.   'Display the value of num and assign it the value 3
  53.   picResults.Print num;
  54.   num = 3
  55. End Sub
  56.